#include "pch.h"
#include "SeqQueue.h"

void InitQueue(Queue *q) {
	q->base = (ElemType*)malloc(sizeof(ElemType)*MAXSIZE);
	assert(q->base != NULL);
	q->front = q->rear = 0;
}

void EnQueue(Queue *q, ElemType x) {
	if (q->rear >= MAXSIZE)
		return;
	q->base[q->rear++] = x;
}

void ShowQueue(Queue *q) {
	for (size_t i = q->front; i < q->rear; i++)
		printf("%d", q->base[i]);

	printf("\n");
}

void DeQueue(Queue *q) {
	if (q->front = q->rear)
		return;
	q->front++;
}